from webdriver.firefox.webdriver import WebDriver
import uuid

class FunctionalTest(object):
	def setUp(self):
		self.driver = WebDriver()
		self.driver.get("http://localhost:8000")

	def tearDown(self):
		self.driver.quit()

	def make_screenshot(self):
		name = "/tmp/screenshot-%s.png" % uuid.uuid4()
		self.driver.save_screenshot(name)
		return "{IMG:%s}" % name

	def do_click(self, button_text):
		element = self.driver.find_element_by_id(button_text)
		element.click()
